package com.leo.csdnspider.controller;

import com.leo.csdnspider.pipeline.*;
import com.leo.csdnspider.tasks.MainScheduled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: Test
 * @Author: Leo
 * @Description: 手动开启开始全部爬虫
 * @Date: 8/29/2019 2:35 PM
 */
@RestController
public class StartAllController {

    @Autowired
    private MainScheduled mainScheduled;

    @Autowired
    private BaseInfoPipeline baseInfoPipeline;

    @Autowired
    public ArchiveInfoPipeline archiveInfoPipeline;

    @Autowired
    private ClassInfoPipeline classInfoPipeline;

    @Autowired
    private PopularInfoPipeline popularInfoPipeline;

    @Autowired
    private LatestCommentPipeline latestCommentPipeline;

    @GetMapping("/startAll")
    @ResponseBody
    public String hello() {
        mainScheduled.startAll();
        return "success";
    }
}
